import unittest
from parameterized import parameterized

from Unittest.CanShuHua.read_parajson import read_data_add, read_data_add2
from Unittest.work01.tools import add

data = [(1,1,2),(1,2,3),(2,2,4)]
class MyTestCase(unittest.TestCase):
    # 参数化
    # @parameterized.expand(data)
    # 参数化，json读取数据
    @parameterized.expand(read_data_add2())
    def test_add(self,a,b,expect):
        print(f"a:{a},b:{b},expect:{expect}")
        self.assertEqual(expect,add(a,b))

